"""
本题要求统计给定整数M和N区间内素数的个数并对它们求和。
"""
m, n = input().split()
m, n = int(m), int(n)
s = 0
count = 0
for i in range(m, n+1):
    if i <= 1:
        continue
    flag = 1
    for j in range(2, i//2+1):
        if i % j == 0:
            flag = -1
            break
    if flag == 1:
        s += i
        count += 1
        print(i)
print(f'{count} {s}')